<?php
    if (!defined('APPPATH')) exit('No direct script access allowed');

    require_once(APPPATH.'libraries/utils/translation/class.translation.php');
    
    if(isset($_GET['lang']))
        $translate = new Translation($_GET['lang'], true);
    else {
        if(!empty($lang))
            $translate = new Translation($lang, true);
        else
            $translate = new Translation('en', true);
    }
?>

<table class="table table-striped" cellpadding="0" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th><?php $translate->__('Name'); ?></th>
            <th><?php $translate->__('Username'); ?></th>
            <th><?php $translate->__('Email'); ?></th>
            <th><?php $translate->__('Options'); ?></th>
        </tr>
    </thead>
    <tbody>
        <?php
            if (!empty($members)) {
                foreach ($members as $key => $member) {
			if ($member['member_id'] > 1) {
        ?>
                    	<tr>
                        	<td><?php echo $member['firstname'] . " " . $member['lastname'] ?></td>
                        	<td><?php echo $member['username'] ?></td>
                        	<td><?php echo $member['email'] ?></td>
                        	<?php  
                            		if ($member['member_id'] != 2) {
                        	?>
                                		<td><a class="btn btn-mini btn-warning" href="<?php echo site_url() . "/router/edit_user/" . $member['member_id'] ?>"><?php $translate->__('edit'); ?></a>  <a class="btn btn-mini btn-danger" href="<?php echo site_url() . "/member/member_controller/delete/" . $member['member_id'] ?>"><?php $translate->__('delete'); ?></a></td>
                        	<?php
                            		} else {
                        	?>
                                		<td></td>
                        	<?php
                            		}
                        	?>
                    </tr>
        <?php
			}
                }
            }
        ?>
    </tbody>
</table>